package net.jalbum.filters;

import java.awt.Cursor;
import java.awt.event.MouseEvent;

public class RedEyeCircle extends ResizableCircle {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6012133226384935520L;
	protected double value1 = 1.0;
	protected double value2 = 0.6;
	protected double valueFactor = 0.5;
	protected double MaxGap = 0.1;
	
	public RedEyeCircle() {
		super();
		this.Radius = 0.05;
		this.showRadius2 = false;
	}
	
	public RedEyeCircle(int width, int height) {
		super(width, height);
		this.Radius = 0.05;
		this.showRadius2 = false;
	}
	
	protected void setMouseCursor(MouseEvent arg0) {
		//similar to setMouseCursor from ResizableCircle only that the CROSSHAIR_CURSOR is now the default
		position = checkState((int)(arg0.getX()),(int)(arg0.getY()));
		Cursor oldCursor = parentPanel.getCursor();
		if(position==MAKE){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
		}else if(position==MOVE){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
		}else if(position==RESIZE_NW || position==RESIZE_NW_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
		}else if(position==RESIZE_NE || position==RESIZE_NE_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
		}else if(position==RESIZE_SE || position==RESIZE_SE_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
		}else if(position==RESIZE_SW || position==RESIZE_SW_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
		}else if(position==RESIZE_N || position==RESIZE_N_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
		}else if(position==RESIZE_E || position==RESIZE_E_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
		}else if(position==RESIZE_S || position==RESIZE_S_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
		}else if(position==RESIZE_W || position==RESIZE_W_2){
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
		}else{
			//Crosshair is now default
			parentPanel.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
		}
		//only repaint if the cursor has changed
		if(oldCursor!=parentPanel.getCursor()){
			parentPanel.renderPreview();
		}
	}
	
	public double getValue1() {
		return value1;
	}

	public void setValue1(double value1) {
		this.value1 = value1;
	}

	public double getValue2() {
		return value2;
	}

	public void setValue2(double value2) {
		this.value2 = value2;
	}

	public double getValueFactor() {
		return valueFactor;
	}

	public void setValueFactor(double valueFactor) {
		this.valueFactor = valueFactor;
	}

	public double getMaxGap() {
		return MaxGap;
	}

	public void setMaxGap(double maxGap) {
		this.MaxGap = maxGap;
	}

}
